<template>
  <div v-if="info" class="game">
    <div class="header">{{info.game_name}}</div>
    <div class="max-w">
      <div class="title">GAME INTRODUCTION VIDEO</div>
      <div class="green"></div>
      <Video class="video" fit="contain" :src="info.video" :poster="info.image" />
      <div class="title">GAME INTRODUCTION TITLE</div>
      <div class="green"></div>
      <div class="html" v-html="info.introduction">
      </div>
    </div>

  </div>

</template>

<script setup>
import { ref } from 'vue'
import { gameInfo } from './game.service'
import { useRoute } from "vue-router"
import Video from './widget/video.vue'
const route = useRoute()
const info = ref()
const getData = () => {
  gameInfo(route.query.id).then((res) => {
    info.value = res.data
  })
}
getData()
</script>
<style lang='scss' scoped>
/* 智能手机（普通手机和宽屏智能手机） */
@media only screen and (max-width: 768px) {
  .html{
    word-wrap: break-word;
  }
}

.header {
  background-image: url("@/assets/image/gameBg.jpg");
  background-size: 100% 100%;
  width: 100%;
  font-size: 45pt;
  font-weight: 600;
  text-align: center;
  line-height: 200px;
  color: #fff;
}
.title {
  font-size: 30pt;
  color: #000;
  font-weight: 600;
  text-align: center;
  margin-bottom: 4px;
}
.green {
  width: 148px;
  height: 5px;
  border-radius: 5px;
  background-color: #b1e69a;
  margin: auto;
  margin-bottom: 26px;
}
.max-w {
  width: 100%;
  padding: 6rem 3rem;
  max-width: 1440px;
  display: flex;
  flex-direction: column;
  align-content: center;
  justify-content: center;
  .video {
    width: 100%;
    margin-bottom: 6rem;
  }
}
.game {
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  .html {
    width: 100%;
    overflow: auto;
    img {
      max-width: 100%;
    }
  }
}
img {
  max-width: 100%;
}
</style>
<style scss>
.game {
  img {
    width: 100% !important;
  }
}
</style>